package com.rlf.sf.legacymapping.xml.object;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

import lombok.ToString;

@XStreamAlias("legacy-permission")
@ToString
public class LegacyPermission {
	
	@XStreamAlias("permission-type")
	@XStreamAsAttribute
	private String permissionType;
	
	@XStreamAsAttribute
	@XStreamAlias("permission-string-value")
	private String permissionStringValue;
	
	@XStreamAsAttribute
	@XStreamAlias("message-key")
	private String messageKey;
	
	@XStreamAlias("rbp-permission")
	private RbpPermission rbpPermission;


	public String getPermissionType() {
		return permissionType;
	}


	public void setPermissionType(String permissionType) {
		this.permissionType = permissionType;
	}


	public String getPermissionStringValue() {
		return permissionStringValue;
	}


	public void setPermissionStringValue(String permissionStringValue) {
		this.permissionStringValue = permissionStringValue;
	}


	public String getMessageKey() {
		return messageKey;
	}


	public void setMessageKey(String messageKey) {
		this.messageKey = messageKey;
	}


	public RbpPermission getRbpPermission() {
		return rbpPermission;
	}


	public void setRbpPermission(RbpPermission rbpPermission) {
		this.rbpPermission = rbpPermission;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}
		LegacyPermission lp = (LegacyPermission) obj;
		return this.permissionType.equals(lp.permissionType) && this.permissionStringValue.equals(lp.permissionStringValue) && this.messageKey.equals(lp.messageKey);
	}
}
